{% extends "blog/blog_base.html" %}


{% block blog_content %}
    <div class="blogMain">

        <!-- Posts  -->
        <div class="blogList">
            {% for post in post_list %}
            <div class="blogItemWrapper">
                <div class="blogTitleBar">
                </div>
                <div class="blogTitle"> <a class='transition' href="{% url xcheng.views.v_blog_post post.pk %}">{{ post.title }}</a></div>
                <div class="blogTime">{{ post.created }}</div>
                <div class="blogItem">
                   
                    
                   
                    <div class="blogBody">{{ post.body|removetags:""|safe }}</div>
                       
                </div>
                <div class="blogCommentLink">
                    <a class='transition' href="{% url xcheng.views.v_blog_post post.pk %}">Comments ({{ post.blogcomment_set.count }})</a>
                </div>
                
            
            </div>
            {% endfor %}


            <!-- Next/Prev page links  -->
            {% if not archive and posts.object_list and posts.paginator.num_pages > 1 %}
            <div class="pagination">
                <span class="step-links">
                    {% if posts.has_previous %}
                        <a class='transition' href= "?page={{ posts.previous_page_number }}">newer entries &lt;&lt; </a>
                    {% endif %}

                    <span class="current">
                        &nbsp;Page {{ posts.number }} of {{ posts.paginator.num_pages }}
                    </span>

                    {% if posts.has_next %}
                        <a class='transition' href="?page={{ posts.next_page_number }}"> &gt;&gt; older entries</a>
                    {% endif %}
                </span>
            </div>
            {% endif %}
        </div>
{% endblock %}

{% block sidebar %}
        <div class="blogSide">
            <div class="blogArchive">
                <div id="monthlyArchiveBar">
                </div>
                <div id="monthlyArchive">Categories
                </div>

                {% for cate in categories %}
                    <span class="blogArchiveMonth">
                    <a class='transition' href="{% url xcheng.views.v_blog_category cate.id %}">{{ cate.name }}</a> 
                    </span><br />
                {% endfor %}

            </div>
            <div class="blogArchive">
                <div id="monthlyArchiveBar">
                </div>
                <div id="monthlyArchive">Monthly Archive
                </div>
                    {% for month in months %}
                        <span class="blogArchiveMonth">
                        <a class='transition' href="{% url xcheng.views.v_blog_month month.0 month.1 %}">{{ month.0 }} {{ month.2 }}</a> 
                        </span><br />
                    {% endfor %}
                
                

               
                
            </div>
        </div>

    </div>


{% endblock %}

